package controllers

import "github.com/astaxie/beego"

type LogController struct {
	BaseController
}

//log demo
func (self *LogController) Demo() {
	//设置输出
	beego.SetLogger("file", `{"filename":"logs/test.log"}`)
	//输出文件名和行号
	beego.SetLogFuncCall(true)
	//设置log级别
	beego.SetLevel(beego.LevelDebug)
	beego.Emergency("this is emergency")
	beego.Alert("this is alert")
	beego.Critical("this is critical")
	beego.Error("this is error")
	beego.Warning("this is warning")
	beego.Notice("this is notice")
	beego.Informational("this is informational")
	beego.Debug("this is debug")

	self.Data["json"] = &LogController{}
	self.ServeJSON()
}
